From d32c226f4fd42bca32abe7e71991c45b006bbefb Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Thu, 17 Mar 2005 00:47:40 +0000 Subject: [PATCH] bitkeeper revision 1.1236.31.6 (4238d3ac4pKI7cNlIOkb6jQx5kNtUA) Fix "timer tick before its due" --- xen/arch/ia64/vcpu.c | 33 ++++++++++++++++++++++++++++++--- xen/include/asm-ia64/config.h | 2 +- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/xen/arch/ia64/vcpu.c b/xen/arch/ia64/vcpu.c index f37aa1ab27..8698167712 100644 --- a/xen/arch/ia64/vcpu.c +++ b/xen/arch/ia64/vcpu.c @@ -511,6 +511,13 @@ void vcpu_pend_interrupt(VCPU *vcpu, UINT64 vector) set_bit(vector,PSCB(vcpu,irr)); } +void early_tick(VCPU *vcpu) +{ + UINT64 *p = &PSCB(vcpu,irr[3]); + printf("vcpu_check_pending: about to deliver early tick\n"); + printf("&irr[0]=%p, irr[0]=0x%lx\n",p,*p); +} + #define IA64_TPR_MMI 0x10000 #define IA64_TPR_MIC 0x000f0 @@ -563,6 +570,14 @@ UINT64 vcpu_check_pending_interrupts(VCPU *vcpu) } //printf("returned to caller\n"); +#if 0 +if (vector == (PSCB(vcpu,itv) & 0xff)) { + UINT64 now = ia64_get_itc(); + UINT64 itm = PSCB(vcpu,domain_itm); + if (now < itm) early_tick(vcpu); + +} +#endif return vector; } @@ -815,14 +830,21 @@ BOOLEAN vcpu_timer_disabled(VCPU *vcpu) return(!itv || !!(itv & 0x10000)); } +BOOLEAN vcpu_timer_inservice(VCPU *vcpu) +{ + UINT64 itv = PSCB(vcpu,itv); + return (test_bit(itv, PSCB(vcpu,insvc))); +} + BOOLEAN vcpu_timer_expired(VCPU *vcpu) { unsigned long domain_itm = PSCB(vcpu,domain_itm); unsigned long now = ia64_get_itc(); - if (domain_itm && (now > domain_itm) && - !vcpu_timer_disabled(vcpu)) return TRUE; - return FALSE; + if (!domain_itm) return FALSE; + if (now < domain_itm) return FALSE; + if (vcpu_timer_disabled(vcpu)) return FALSE; + return TRUE; } void vcpu_safe_set_itm(unsigned long val) @@ -956,6 +978,7 @@ void vcpu_pend_timer(VCPU *vcpu) UINT64 itv = PSCB(vcpu,itv) & 0xff; if (vcpu_timer_disabled(vcpu)) return; + if (vcpu_timer_inservice(vcpu)) return; #if 1 // attempt to flag "timer tick before its due" source { @@ -1071,6 +1094,7 @@ while(1); IA64FAULT vcpu_cover(VCPU *vcpu) { + // TODO: Only allowed for current vcpu REGS *regs = vcpu_regs(vcpu); if (!PSCB(vcpu,interrupt_collection_enabled)) { @@ -1229,6 +1253,7 @@ IA64FAULT vcpu_get_pmd(VCPU *vcpu, UINT64 reg, UINT64 *pval) IA64FAULT vcpu_bsw0(VCPU *vcpu) { + // TODO: Only allowed for current vcpu REGS *regs = vcpu_regs(vcpu); unsigned long *r = ®s->r16; unsigned long *b0 = &PSCB(vcpu,bank0_regs[0]); @@ -1244,6 +1269,7 @@ IA64FAULT vcpu_bsw0(VCPU *vcpu) IA64FAULT vcpu_bsw1(VCPU *vcpu) { + // TODO: Only allowed for current vcpu REGS *regs = vcpu_regs(vcpu); unsigned long *r = ®s->r16; unsigned long *b0 = &PSCB(vcpu,bank0_regs[0]); @@ -1535,6 +1561,7 @@ IA64FAULT vcpu_ptc_l(VCPU *vcpu, UINT64 vadr, UINT64 addr_range) // on the physical address, which is guaranteed to flush the same cache line IA64FAULT vcpu_fc(VCPU *vcpu, UINT64 vadr) { + // TODO: Only allowed for current vcpu UINT64 mpaddr, ps; IA64FAULT fault; unsigned long match_dtlb(VCPU *, unsigned long, unsigned long *, unsigned long *); diff --git a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h index ed6568bc09..597654396a 100644 --- a/xen/include/asm-ia64/config.h +++ b/xen/include/asm-ia64/config.h @@ -1,6 +1,6 @@ // control flags for turning on/off features under test #undef CLONE_DOMAIN0 -//#define CLONE_DOMAIN0 1 +//#define CLONE_DOMAIN0 5 // manufactured from component pieces -- 2.30.2